package zheezes.eisp.collect.model.impl.gbw;

import org.apache.log4j.Logger;

import zheezes.eisp.collect.model.CollectManager;
import zheezes.eisp.collect.model.CollectTaskHandler;
import zheezes.eisp.data.orm.CollectTask;


public class GbwCollectManager extends CollectManager {
	private static final Logger logger = Logger.getLogger(GbwCollectManager.class);
	
	static {
		logger.debug("loaded");
	}

	@Override
	public CollectTaskHandler select(CollectTask task) {
		CollectTaskHandler handler = null;

		switch (task.getType().intValue()) {
		case CollectTask.VIP_HOUR_FROZEN_TASK:
			handler = new GbwVipFrozenCollectTaskHandler();
			break;
		case CollectTask.RM_DAILY_FROZEN_TASK:
			handler = new GbwConResMeterDailyFrozenCollectTaskHandler();
			break;
		case CollectTask.SM_INSTANT_VALUE_TASK:
			handler = new GbwSummatorInstantValueCollectTaskHandler();
			break;
		case CollectTask.SM_DAILY_FROZEN_TASK:
			handler = new GbwSummatorDailyFrozenCollectTaskHandler();
			break;
		}
		/*
		if (handler != null) {
			handler.setTask(task);
		}
		*/
		return handler;
	}
}
